package cn.com.contec.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeUtil {

	public static String delNull(String string)
	{
		String string2 = string;
		if (string==null) {
			string2 = "";
		}
		return string2;
	}
	public static long getNowTimeT()
	{
		return System.currentTimeMillis();
	}
	public static String getNowTime()
	{
		return new SimpleDateFormat("yyyy-MM-dd HH:mm")
		.format(new Date());
	}
	/**
	 * 
	 * @param trade
	 * @param flag
	 *            閺勵垰鎯侀悽銊︾壐瀵繐瀵�
	 */
	public static String getCurrentDate(boolean flag) {
		String fmtStr = "";
		if (flag) {
			fmtStr = "yyyy-MM-dd";
		} else {
			fmtStr = "yyyyMMdd";
		}
		return new SimpleDateFormat(fmtStr).format(new Date());
	}

	public static String getCurrentDate_F() {
		return new SimpleDateFormat("HH:mm:ss").format(new Date());
	}

	public static String getCurrentDateTime() {
		return new SimpleDateFormat("HH:mm:ss").format(new Date());
	}

	public static String getCurrentDate() {
		return new SimpleDateFormat("yyyy-MM-dd").format(new Date());
	}

}
